package com.quanquan.store.shenxinpay.utils;

import java.math.BigDecimal;
import java.text.DecimalFormat;

public class FinancialUtils {
	private final static BigDecimal coeff = new BigDecimal(100);

	public static void main(String[] args) {
		System.out.println(new DecimalFormat("#,##0.00").format(FinancialUtils.getYuan(100)));
	}
	
	public static Double getYuan(Integer feng){
		return new BigDecimal(feng).divide(coeff).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
	}
	
	public static Integer getFeng(Double yuan){
		return new BigDecimal(yuan).multiply(coeff).intValue();
	}
}
